import request from './http';
import {AddSsoUserGroupMapping, SsoUserGroupMapping} from "@/types/entity";

/**
 * 用户组关系映射表 前端接口
 */
export default class SsoUserGroupMappingApi {
  static page(data: SsoUserGroupMapping) {
    let { index, size, ...vo } = data;
    return request.post(`/ssoUserGroupMapping/page/${index}/${size}`, vo);
  }

  static pageUser(data: any) {
    let { index, size, ...vo } = data;
    return request.post(`/ssoUserGroupMapping/pageUser/${index}/${size}`, vo);
  }

  static save(data: AddSsoUserGroupMapping) {
    return request.post<AddSsoUserGroupMapping>('/ssoUserGroupMapping', data);
  }

  static update(data: SsoUserGroupMapping) {
    return request.put<SsoUserGroupMapping>('/ssoUserGroupMapping', data);
  }

  static delete(data:AddSsoUserGroupMapping) {
    return request.post('/ssoUserGroupMapping/delete', data);
  }

  static list(data: SsoUserGroupMapping) {
    return request.post('/ssoUserGroupMapping/list', data);
  }

  static getById(id: number) {
    return request.get(`/ssoUserGroupMapping/get/${id}`);
  }


}
